<%- include('../includes/header') %>
    <link rel="stylesheet" href="/css/shop.css">
</head>
<body>
    <%- include('../includes/navigation') %>
    <main>
        <% if ( prods.length ) { %>
        <div class="gird">
            <% for (product of prods) { %>
            <article class="card product-item">
                <header class="card-header">
                    <h1 class="product-title"><%= product.title %></h1>
                </header>
                <div class="card-image">
                    <img src="<%= product.imageUrl %>" alt="<%= product.title %>">
                </div>
                <div class="card-content">
                    <h1 class="product-price">￥<%= product.price %></h1>
                    <p class="product-description"><%= product.description %></p>
                </div>
                <div class="card-footer">
                    <a class="btn" href="/admin/edit-product/<%= product.id %>">编辑产品</a>
                    <form class="d-inline-block" action="/admin/delete-product" method="post">
                        <input type="hidden" name="prodId" value="<%= product.id %>">
                        <button class="btn" type="submit">删除</button>
                    </form>
                </div>
            </article>
            <% } %>
        </div>
        <% } else { %>
        <h1>没有任何商品</h1>
        <% } %>
    </main>
<%- include('../includes/end') %>